// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** addComment POST /api/articleComment/add */
export async function addCommentUsingPost(
  body: API.ArticleCommentAddRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsestring>('/api/articleComment/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteComment POST /api/articleComment/delete */
export async function deleteCommentUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseboolean>('/api/articleComment/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    data: body,
    ...(options || {}),
  });
}

/** listCommentByPage GET /api/articleComment/list/page */
export async function listCommentByPageUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listCommentByPageUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageVo>('/api/articleComment/list/page', {
    method: 'GET',
    headers: {
      'JWT': localStorage.getItem('loginUser') || 'manba',
    },
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
